package com.an.blog.admin.domain.bo;

import com.an.common.core.domain.BaseEntity;
import com.an.common.core.validate.AddGroup;
import com.an.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 博客文章业务对象 blog_article
 *
 * @author Ann
 * @date 2023-05-08
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class BlogArticleBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long articleId;

    /**
     * 分类id
     */
    @NotNull(message = "分类id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long categoryId;

    /**
     * 文章标题
     */
    @NotBlank(message = "文章标题不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 60,message = "文章标题不能大于60个字符")
    private String articleTitle;

    /**
     * 文章内容
     */
    @NotBlank(message = "文章内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String articleContent;

    /**
     * 文章图片
     */
    @NotNull(message = "文章图片不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long articleImage;

    /**
     * 文章类型（0原创 1转载 2翻译）
     */
    @NotBlank(message = "文章类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String articleType;

    /**
     * 原文链接
     */
    private String originalUrl;

    /**
     * 是否置顶（0否 1是）
     */
    @NotBlank(message = "是否置顶不能为空", groups = { AddGroup.class, EditGroup.class })
    private String isTop;

    /**
     * 状态（0正常 1停用）
     */
    @NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;

    /**
     * 点赞数量
     */
    private Long likedCount;

    /**
     * 浏览量
     */
    private Long viewedCount;

    /**
     *  备注
     */
    private String remark;


    /**
     * 文章标签
     */
    @NotEmpty(message = "文章标签不能为空", groups = { AddGroup.class, EditGroup.class } )
    private Long[] articleTags;
}
